package com.ecloud.hbase.service;

import com.ecloud.hbase.entities.TdbPresentHbaseTable;
import com.ecloud.trend.entities.TdbDaily;
import com.ecloud.trend.vo.TdbEnvironmentPresentVo;
import com.ecloud.trend.vo.TdbPresentVo;

import java.util.List;
import java.util.Map;

/**
 * hbase与Tdb对象整合服务
 *
 * @author Squbi
 */
public interface HbaseTdbService {
    /**
     * 获取每日对象数据
     *
     * @param rowKey 行键
     * @return {@link TdbDaily}
     * @author Squbi
     * @date 2021/7/23 10:24
     */
    List<TdbDaily> getDailyAndParse(String rowKey);

    /**
     * 设置实时数据到hbase
     *
     * @param tableClass    表类
     * @param tdbPresentVos {@link TdbPresentVo}
     * @author Squbi
     * @date 2021/7/23 17:11
     */
    <T extends TdbPresentHbaseTable> void setBuildingPresentData(Class<T> tableClass, List<TdbPresentVo> tdbPresentVos);

    /**
     * 从hbase获取所有的实时数据记录
     *
     * @param tableClass   表类
     * @param buildingName 建筑的名称
     * @return Map < time,List< TdbPresentVo > >
     * @author Squbi
     * @date 2021/7/23 17:34
     */
    <T extends TdbPresentHbaseTable> Map<String, List<TdbPresentVo>> getBuildingPresentAllData(Class<T> tableClass, String buildingName);

    /**
     * 从hbase获取指定时间的实时数据记录
     *
     * @param keyTime      时间戳 格式为yyyyMMddHHm0
     * @param tableClass   表类
     * @param buildingName 建筑的名称
     * @return Map < time,List< TdbPresentVo > >
     * @author Squbi
     * @date 2021/7/23 17:34
     */
    <T extends TdbPresentHbaseTable> Map<String, List<TdbPresentVo>> getBuildingPresentData(Class<T> tableClass, String buildingName, String keyTime);

    /**
     * 设置实时环境数据到hbase
     *
     * @param tdbPresentVos {@link TdbEnvironmentPresentVo}
     * @author Squbi
     * @date 2021/7/23 17:11
     */
    void setEnvironmentPresentData(List<TdbEnvironmentPresentVo> tdbPresentVos);

    /**
     * 从hbase获取指定的实时环境数据记录
     *
     * @param timeKey 时间键
     * @return List < TdbEnvironmentPresentVo>
     * @author Squbi
     * @date 2021/7/23 17:34
     */
    List<TdbEnvironmentPresentVo> getEnvironmentPresentData(String timeKey);

}
